unification algorithm